﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ttbit.core;
using ttbit.WorkingSpace;

namespace ttbit.WorkingSpace
{
    class Resource_Texture : IWorkResource
    {
        public const string TypeStr = "Texture";



        public Resource_Texture(string name)
        {
            this.Name = name;
        }
        public string Name
        {
            get;
            private set;
        }
        [Category("res")]
        public int Width
        {
            get
            {
                return texture.Width;
            }
        }
        [Category("res")]
        public int Height
        {
            get
            {
                return texture.Height;
            }
        }

        public bool Dirty
        {
            get;
            private set;
        }
        public void MarkDirty()
        {
            Dirty = true;
        }
        public void ClearDirty()
        {
            Dirty = false;
        }

        public Texture texture = null;

        [Category("base")]
        public string TypeName => TypeStr;

        public void Dispose()
        {
            if (texture != null) texture.Dispose();
            texture = null;
        }

        public string[] RefResource => null;

        public bool ContainsResource(string name) => false;
    }
}
